<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<img src="images/title91.png" alt="" width="235" height="1" />
<logic:present  name="cartCar">
    <form action="CarOrder.do" method="post">
        <TABLE class="table0" cellSpacing=0 cellPadding=0 align=center bgcolor="#FFFFFF">
            <TR>
                <TD class="td1"></TD>

                <TD class="top"></TD>
                <TD class="topright"></TD>
            </TR>
            <TR>
                <TD class="middleleft" rowSpan=3></TD>
                <TD bgcolor="#F0F0F0">
                    <center> <h4>Booking </h4></center>

                </TD>
                <TD class="middleright" rowSpan=3></TD>
            </TR>
            <TR>
                <TD class="middlecenter"></TD>
            </TR>
            <TR>
                <TD class="main">
                    <table width="100%" border="0">
                        <tr>
                            <td>Car name </td>
                            <td>Price </td>
                            <td>Quantity</td>
                            <td>Driver</td>
                            <td>Pickup date </td>
                            <td>Dropoff date </td>
                            <td>Total</td>
                        </tr>
                        <logic:iterate id="cartCar" name="cartCar">
                            <tr>
                                <td><bean:write name="cartCar" property="carsDTO.carName"/></td>
                                <td><input  type="text" readonly size="2"  id="price<bean:write name="cartCar" property="carId"/>" name="price<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="carsDTO.price"/>"></td>
                                <td><input  type="text" size="2" id="qty<bean:write name="cartCar" property="carId"/>" name="qty<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="qty"/>"onkeypress="Sum('pickup<bean:write name="cartCar" property="carId"/>','dropoff<bean:write name="cartCar" property="carId"/>','total<bean:write name="cartCar" property="carId"/>','qty<bean:write name="cartCar" property="carId"/>','price<bean:write name="cartCar" property="carId"/>');"></td>
                                <td>
                                    <logic:equal name="cartCar" property="driver" value="1">
                                        <select  name="driver<bean:write name="cartCar" property="carId"/>" id="driver<bean:write name="cartCar" property="carId"/>">
                                            <option value="1" >Yes</option>
                                            <option value="0">No</option>
                                        </select>
                                    </logic:equal>
                                    <logic:equal name="cartCar" property="driver" value="0">
                                        <select  name="driver<bean:write name="cartCar" property="carId"/>" id="driver<bean:write name="cartCar" property="carId"/>">
                                            <option value="0">No</option>
                                            <option value="1" >Yes</option>
                                        </select>
                                    </logic:equal>

                                </td>
                                <td><input type="text" size="10"  id="pickup<bean:write name="cartCar" property="carId"/>" name="pickup<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="pickUpdate"/>">
                                    <img src="images/cal.gif" onclick="displayCalendar(document.getElementById('pickup<bean:write name="cartCar" property="carId"/>'),'mm/dd/yyyy',this)"></td>
                                <td><input type="text" size="10" id="dropoff<bean:write name="cartCar" property="carId"/>" name="dropoff<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="dropOffDate"/>" onChange="checkDate('pickup<bean:write name="cartCar" property="carId"/>','dropoff<bean:write name="cartCar" property="carId"/>','total<bean:write name="cartCar" property="carId"/>','qty<bean:write name="cartCar" property="carId"/>','price<bean:write name="cartCar" property="carId"/>');">
                                    <img src="images/cal.gif" onclick="displayCalendar(document.getElementById('dropoff<bean:write name="cartCar" property="carId"/>'),'mm/dd/yyyy',this)">
                                </td>
                                <td><input readonly type="text" style="color:#FF0000" id="total<bean:write name="cartCar" property="carId"/>" name="total<bean:write name="cartCar" property="carId"/>" value="<bean:write name="cartCar" property="total"/>"><a href="CarOrder.do?action=remove&carId=<bean:write name="cartCar" property="carId"/>">remove</a></td>
                            </tr>
                        </logic:iterate>
                    </table>
                    <input type="button" value="continue bookking" onclick="history.back();"> <input type="submit" value="update" name="action" style="background-color:#dhi555">
                </TD>
            </TR>

            <TR>
                <TD class="bottom"><IMG border=0 alt="" src="img/pod_main_bottom_left.gif"></TD>
                <TD class="bottomright"><P align=right>&nbsp;</P></TD>
                <TD class="bottomleft"><IMG border=0 alt="" src="img/pod_main_bottom_right.gif"></TD>
            </TR>
        </TABLE>
        <div>
            <b> <font color="red">You must Register your infomation:<br/></font></b>
            <TABLE class="table0" cellSpacing=0 cellPadding=0 align=center bgcolor="#FFFFFF">
                <TR>
                    <TD class="td1"></TD>

                    <TD class="top"></TD>
                    <TD class="topright"></TD>
                </TR>
                <TR>
                    <TD class="middleleft" rowSpan=3></TD>
                    <TD bgcolor="#F0F0F0">
                        <center> <h4>Booking Form</h4></center>

                    </TD>
                    <TD class="middleright" rowSpan=3></TD>
                </TR>
                <TR>
                    <TD class="middlecenter"></TD>
                </TR>
                <TR>
                    <TD class="main">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <!--DWLayoutTable-->
                            <tr>
                                <td >Full name <font color="red">*</font></td>
                                <td ><input type="text"  size="18" name="fullName" id="fullName"></td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td >Email <font color="red">*</font></td>
                                <td ><input type="text" size="27" name="email" id="email">
                                    Phone <font color="red">*</font>
                                    <input type="text" name="phone" id="phone">
                                    Fax<input type="text" name="fax" id="fax" >
                                </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td >Birth date</td>
                                <td >
                                    <select name="birthDayM" id="birthDayM" onchange="getbirth()">
                                        <option value="Month">Month</option>
                                        <option value="1">January</option>
                                        <option value="2">February</option>
                                        <option value="3">March</option>
                                        <option value="4">April</option>
                                        <option value="5">May</option>
                                        <option value="6">June</option>
                                        <option value="7">July</option>
                                        <option value="8">August</option>
                                        <option value="9">September</option>
                                        <option value="10">October</option>
                                        <option value="11">November</option>
                                        <option value="12">December</option>
                                    </select>

                                    <select name="birthDayD" id="birthDayD" onchange="getbirth()">
                                        <option value="Day">Day</option>
                                        <option value="1">1</option>
                                        <option value="2">2</option>
                                        <option value="3">3</option>
                                        <option value="4">4</option>
                                        <option value="5">5</option>
                                        <option value="6">6</option>
                                        <option value="7">7</option>
                                        <option value="8">8</option>
                                        <option value="9">9</option>
                                        <option value="10">10</option>
                                        <option value="11">11</option>
                                        <option value="12">12</option>
                                        <option value="13">13</option>
                                        <option value="14">14</option>
                                        <option value="15">15</option>
                                        <option value="16">16</option>
                                        <option value="17">17</option>
                                        <option value="18">18</option>
                                        <option value="19">19</option>
                                        <option value="20">20</option>
                                        <option value="21">21</option>
                                        <option value="22">22</option>
                                        <option value="23">23</option>
                                        <option value="24">24</option>
                                        <option value="25">25</option>
                                        <option value="26">26</option>
                                        <option value="27">27</option>
                                        <option value="28">28</option>
                                        <option value="29">29</option>
                                        <option value="30">30</option>
                                        <option value="31">31</option>
                                    </select>
                                    <input type="text" name="birthDayY" id="birthDayY" size="6" onchange="getbirth()">
                                    <input type="hidden" name="birth" id="birth" size="6">
                                </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td >Country/Region <font color="red">*</font></td>
                                <td >
                                    <select name="country" id="country">
                                        <option value="Country">Country</option>
                                        <option value="AF">Afghanistan</option>
                                        <option value="AL">Albania</option>
                                        <option value="DZ">Algeria</option>
                                        <option value="AS">American Samoa</option>
                                        <option value="AD">Andorra</option>
                                        <option value="AO">Angola</option>
                                        <option value="AI">Anguilla</option>
                                        <option value="AQ">Antarctica</option>
                                        <option value="AG">Antigua and Barbuda</option>
                                        <option value="AR">Argentina</option>
                                        <option value="AM">Armenia</option>
                                        <option value="AW">Aruba</option>
                                        <option value="AU">Australia</option>
                                        <option value="AT">Austria</option>
                                        <option value="AZ">Azerbaijan</option>
                                        <option value="BS">Bahamas</option>
                                        <option value="BH">Bahrain</option>
                                        <option value="BD">Bangladesh</option>
                                        <option value="BB">Barbados</option>
                                        <option value="BY">Belarus</option>
                                        <option value="BE">Belgium</option>
                                        <option value="BZ">Belize</option>
                                        <option value="BJ">Benin</option>
                                        <option value="BM">Bermuda</option>
                                        <option value="BT">Bhutan</option>
                                        <option value="BO">Bolivia</option>
                                        <option value="BA">Bosnia and Herzegowina</option>
                                        <option value="BW">Botswana</option>
                                        <option value="BV">Bouvet Island</option>
                                        <option value="BR">Brazil</option>
                                        <option value="IO">British Indian Ocean Territory</option>
                                        <option value="BN">Brunei Darussalam</option>
                                        <option value="BG">Bulgaria</option>
                                        <option value="BF">Burkina Faso</option>
                                        <option value="BI">Burundi</option>
                                        <option value="KH">Cambodia</option>
                                        <option value="CM">Cameroon</option>
                                        <option value="CA">Canada</option>
                                        <option value="CV">Cape Verde</option>
                                        <option value="KY">Cayman Islands</option>
                                        <option value="CF">Central African Republic</option>
                                        <option value="TD">Chad</option>
                                        <option value="CL">Chile</option>
                                        <option value="CN">China</option>
                                        <option value="CX">Christmas Island</option>
                                        <option value="CC">Cocos (Keeling) Islands</option>
                                        <option value="CO">Colombia</option>
                                        <option value="KM">Comoros</option>
                                        <option value="CG">Congo</option>
                                        <option value="CD">Congo, Democratic Republic of the (Zaire)</option>
                                        <option value="CK">Cook Islands</option>
                                        <option value="CR">Costa Rica</option>
                                        <option value="CI">Cote D'Ivoire</option>
                                        <option value="HR">Croatia (local name: Hrvatska)</option>
                                        <option value="CY">Cyprus</option>
                                        <option value="CZ">Czech Republic</option>
                                        <option value="DK">Denmark</option>
                                        <option value="DJ">Djibouti</option>
                                        <option value="DM">Dominica</option>
                                        <option value="DO">Dominican Republic</option>
                                        <option value="TP">East Timor</option>
                                        <option value="EC">Ecuador</option>
                                        <option value="EG">Egypt</option>
                                        <option value="SV">El Salvador</option>
                                        <option value="GQ">Equatorial Guinea</option>
                                        <option value="ER">Eritrea</option>
                                        <option value="EE">Estonia</option>
                                        <option value="DT">Ethiopia</option>
                                        <option value="FK">Falkland Islands (Malvinas)</option>
                                        <option value="FO">Faroe Islands</option>
                                        <option value="FJ">Fiji</option>
                                        <option value="FI">Finland</option>
                                        <option value="FR">France</option>
                                        <option value="FX">France, Metropolitan</option>
                                        <option value="GF">French Guiana</option>
                                        <option value="PF">French Polynesia</option>
                                        <option value="TF">French Southern Territories</option>
                                        <option value="GA">Gabon</option>
                                        <option value="GM">Gambia</option>
                                        <option value="GE">Georgia</option>
                                        <option value="DE">Germany</option>
                                        <option value="GH">Ghana</option>
                                        <option value="GI">Gibraltar</option>
                                        <option value="GR">Greece</option>
                                        <option value="GL">Greenland</option>
                                        <option value="GD">Grenada</option>
                                        <option value="GP">Guadeloupe</option>
                                        <option value="GU">Guam</option>
                                        <option value="GT">Guatemala</option>
                                        <option value="GN">Guinea</option>
                                        <option value="GW">Guinea-Bissau</option>
                                        <option value="GY">Guyana</option>
                                        <option value="HT">Haiti</option>
                                        <option value="HM">Heard and Mc Donald Islands</option>
                                        <option value="HN">Honduras</option>
                                        <option value="HK">Hong Kong</option>
                                        <option value="HU">Hungary</option>
                                        <option value="IS">Iceland</option>
                                        <option value="IN">India</option>
                                        <option value="ID">Indonesia</option>
                                        <option value="IE">Ireland</option>
                                        <option value="IL">Israel</option>
                                        <option value="IT">Italy</option>
                                        <option value="JM">Jamaica</option>
                                        <option value="JP">Japan</option>
                                        <option value="JO">Jordan</option>
                                        <option value="KZ">Kazakhstan</option>
                                        <option value="KE">Kenya</option>
                                        <option value="KI">Kiribati</option>
                                        <option value="KR">Korea, Republic of</option>
                                        <option value="KW">Kuwai</option>
                                        <option value="KG">Kyrgyzstan</option>
                                        <option value="LA">Lao Peoples Democratic Republic</option>
                                        <option value="LV">Latvia</option>
                                        <option value="LB">Lebanon</option>
                                        <option value="LS">Lesotho</option>
                                        <option value="LR">Liberia</option>
                                        <option value="LI">Liechtenstein</option>
                                        <option value="LT">Lithuania</option>
                                        <option value="LU">Luxembourg</option>
                                        <option value="MO">Macau</option>
                                        <option value="MK">Macedonia</option>
                                        <option value="MG">Madagascar</option>
                                        <option value="MW">Malawi</option>
                                        <option value="MY">Malaysia</option>
                                        <option value="MV">Maldives</option>

                                        <option value="ML">Mali</option>
                                        <option value="MT">Malta</option>
                                        <option value="MH">Marshall Islands</option>
                                        <option value="MQ">Martinique</option>
                                        <option value="MR">Mauritania</option>
                                        <option value="MU">Mauritius</option>
                                        <option value="YT">Mayotte</option>
                                        <option value="MX">Mexico</option>
                                        <option value="FM">Micronesia, Federated States of</option>
                                        <option value="MD">Moldova, Republic of</option>
                                        <option value="MC">Monaco</option>
                                        <option value="MN">Mongolia</option>
                                        <option value="MS">Montserrat</option>
                                        <option value="MA">Morocco</option>
                                        <option value="MZ">Mozambique</option>
                                        <option value="MM">Myanmar</option>
                                        <option value="NA">Namibia</option>
                                        <option value="NR">Nauru</option>
                                        <option value="NP">Nepal</option>
                                        <option value="NL">Netherlands</option>
                                        <option value="AN">Netherlands Antilles</option>
                                        <option value="NC">New Caledonia</option>
                                        <option value="NZ">New Zealand</option>
                                        <option value="NI">Nicaragua</option>
                                        <option value="NE">Niger</option>
                                        <option value="NG">Nigeria</option>
                                        <option value="NU">Niue</option>
                                        <option value="NF">Norfolk Island</option>
                                        <option value="MP">Northern Mariana Islands</option>
                                        <option value="NO">Norway</option>
                                        <option value="OM">Oman</option>
                                        <option value="PK">Pakistan</option>
                                        <option value="PW">Palau</option>
                                        <option value="PS">Palestinian Territory, Occupied</option>
                                        <option value="PA">Panama</option>
                                        <option value="PG">Papua New Guinea</option>
                                        <option value="PY">Paraguay</option>
                                        <option value="PE">Peru</option>
                                        <option value="PH">Philippines</option>
                                        <option value="PN">Pitcairn</option>
                                        <option value="PL">Poland</option>
                                        <option value="PT">Portugal</option>
                                        <option value="PR">Puerto Rico</option>
                                        <option value="QA">Qatar</option>
                                        <option value="RE">Reunion</option>
                                        <option value="RO">Romania</option>
                                        <option value="RU">Russian Federation</option>
                                        <option value="RW">Rwanda</option>
                                        <option value="KN">Saint Kitts and Nevis</option>
                                        <option value="LC">Saint Lucia</option>
                                        <option value="PM">Saint Pierre and Miquelon</option>
                                        <option value="VC">Saint Vincent and the Grenadines</option>
                                        <option value="WS">Samoa</option>
                                        <option value="SM">San Marino</option>
                                        <option value="ST">Sao Tome and Principe</option>
                                        <option value="SA">Saudi Arabia</option>
                                        <option value="SN">Senegal</option>
                                        <option value="SC">Seychelles</option>
                                        <option value="SL">Sierra Leone</option>
                                        <option value="SG">Singapore</option>
                                        <option value="SK">Slovakia (Slovak Republic)</option>
                                        <option value="SI">Slovenia</option>
                                        <option value="SB">Solomon Islands</option>
                                        <option value="SO">Somalia</option>
                                        <option value="ZA">South Africa</option>
                                        <option value="GS">South Georgia/S. Sandwich Islands</option>
                                        <option value="ES">Spain</option>
                                        <option value="LK">Sri Lanka</option>
                                        <option value="SH">St. Helena</option>
                                        <option value="SR">Suriname</option>
                                        <option value="SJ">Svalbard and Jan Mayen Islands</option>
                                        <option value="SZ">Swaziland</option>
                                        <option value="SE">Sweden</option>
                                        <option value="CH">Switzerland</option>
                                        <option value="TW">Taiwan</option>
                                        <option value="TJ">Tajikistan</option>
                                        <option value="TZ">Tanzania, United Republic of</option>
                                        <option value="TH">Thailand</option>
                                        <option value="TG">Togo</option>
                                        <option value="TK">Tokelau</option>
                                        <option value="TO">Tonga</option>
                                        <option value="TT">Trinidad and Tobago</option>
                                        <option value="TN">Tunisia</option>
                                        <option value="TR">Turkey</option>
                                        <option value="TM">Turkmenistan</option>
                                        <option value="TC">Turks and Caicos Islands</option>
                                        <option value="TV">Tuvalu</option>
                                        <option value="UG">Uganda</option>
                                        <option value="UA">Ukraine</option>
                                        <option value="AE">United Arab Emirates</option>
                                        <option value="GB">United Kingdom</option>
                                        <option value="UM">United States Minor Outlying Islands</option>
                                        <option value="US">United States of America</option>
                                        <option value="UY">Uruguay</option>
                                        <option value="UZ">Uzbekistan</option>
                                        <option value="VU">Vanuatu</option>
                                        <option value="VA">Vatican City State (Holy See)</option>
                                        <option value="VE">Venezuela</option>
                                        <option value="VN">Viet Nam</option>
                                        <option value="VG">Virgin Islands (British)</option>
                                        <option value="VI">Virgin Islands (U.S.)</option>
                                        <option value="WF">Wallis and Futuna Islands</option>
                                        <option value="EH">Western Sahara</option>
                                        <option value="YE">Yemen</option>
                                        <option value="YU">Yugoslavia</option>
                                        <option value="ZM">Zambia</option>
                                        <option value="ZW">Zimbabwe</option>
                                    </select></td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td >State/Province</td>
                                <td ><input type="text" name="state" id="state" size="15"></td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>Address</td>
                                <td ><textarea  rows="2" cols="50" name="add" id="add"></textarea></td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td >Job</td>
                                <td ><select name="job" id="job" onchange="getvalues();">
                                        <option value="Job">Job</option>
                                        <logic:present name="listJob">
                                            <logic:iterate name="listJob" id="listJob">
                                                <option value="<bean:write name="listJob" property="jobId"/>"><bean:write name="listJob" property="jobName"/></option>
                                            </logic:iterate>
                                        </logic:present>
                                    </select>
                                    <input type="hidden" id="jobId" name="jobId">
                                </td>
                            </tr>
                            <tr><td>
                                    &nbsp;
                                </td>
                            </tr>

                            <tr>

                                <td  colspan="2"><input type="submit" value="Submit" name="action" onclick="return formValidator()"></td>
                            </tr>
                        </table>
                    </TD>
                </TR>

                <TR>
                    <TD class="bottom"><IMG border=0 alt="" src="img/pod_main_bottom_left.gif"></TD>
                    <TD class="bottomright"><P align=right>&nbsp;</P></TD>
                    <TD class="bottomleft"><IMG border=0 alt="" src="img/pod_main_bottom_right.gif"></TD>
                </TR>
            </TABLE>
        </div>

    </form>

</logic:present>
<logic:notPresent name="cartCar">
    gio hang cua ban khong con san pham<br/>
    <a href="Car.do?action=detail&id=${id}">click here go to back this car</a>
</logic:notPresent>

<script language="JavaScript">
    function getvalues(){
        document.getElementById('jobId').value = document.getElementById('job').value;
    }
    function getbirth(){
        document.getElementById('birth').value =document.getElementById('birthDayM').value +'/'
            + document.getElementById('birthDayD').value + '/' + document.getElementById('birthDayY').value;;
    }
    function checkDate(element1,element2,element3,qty,price){
        var DtDiff;
        Date1 = new Date (document.getElementById(element1).value);
        Date2 = new Date (document.getElementById(element2).value);
        DaysDiff = Math.floor ((Date2 - Date1))/86400000;
        if(DaysDiff <= 0){
            alert("Drop off day > pick up day");
            //return false
        }else{
            document.getElementById(element3).value = document.getElementById(qty).value * DaysDiff * document.getElementById(price).value;
            //return true;
        }
    }
    function Sum(element1,element2,element3,qty,price){
        var DaysDiff;
        if(document.getElementById(element1).value == '' || document.getElementById(element2).value == ''){
            DaysDiff = 1;
        }else{
            Date1 = new Date (document.getElementById(element1).value);
            Date2 = new Date (document.getElementById(element2).value);
            DaysDiff = Math.floor ((Date2 - Date1))/86400000;
        }
        if(DaysDiff <= 0){
            document.getElementById(element3).value = document.getElementById(qty).value  * document.getElementById(price).value;
        }else{
            document.getElementById(element3).value = document.getElementById(qty).value * DaysDiff * document.getElementById(price).value;
            //return true;
        }
    }
    // If the length of the element's string is 0 then display helper message
    function notEmpty(elem, helperMsg){
        if(elem.value.length == 0){
            alert(helperMsg);
            elem.focus(); // set the focus to this input
            return false;
        }
        return true;
    }
    // If the element's string matches the regular expression it is all numbers
    function isNumeric(elem, helperMsg){
        var numericExpression = /^[0-9]+$/;
        if(elem.value.match(numericExpression)){
            return true;
        }else{
            alert(helperMsg);
            elem.focus();
            return false;
        }
    }
    //check elem chose or not
    function checkCountry(elem, helperMsg){
        if(elem.value == "Country"){
            alert(helperMsg);
            elem.focus();
            return false;
        }else{
            return true;
        }
    }
    function checkMonth(elem, helperMsg){
        if(elem.value == "Month"){
            alert(helperMsg);
            elem.focus();
            return false;
        }else{
            return true;
        }
    }
    function checkDay(elem, helperMsg){
        if(elem.value == "Day"){
            alert(helperMsg);
            elem.focus();
            return false;
        }else{
            return true;
        }
    }

    function checkJob(elem, helperMsg){
        if(elem.value == "Job"){
            alert(helperMsg);
            elem.focus();
            return false;
        }else{
            return true;
        }
    }
    function emailValidator(elem, helperMsg){
        var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
        if(elem.value.match(emailExp)){
            return true;
        }else{
            alert(helperMsg);
            elem.focus();
            return false;
        }
    }
    function formValidator(){
        // Make quick references to our fields
        var fullName = document.getElementById('fullName');
        var email = document.getElementById('email');
        var phone = document.getElementById('phone');
        var month = document.getElementById('birthDayM');
        var day = document.getElementById('birthDayD');
        var year = document.getElementById('birthDayY');
        var country = document.getElementById('country');
        var add = document.getElementById('add');
        var job = document.getElementById('job');
        // Check each input in the order that it appears in the form!
        if(notEmpty(fullName, "Please enter your name")){
            if(emailValidator(email, "Please enter a valid email address")){
                if(isNumeric(phone, "Please enter your phone")){
                    if(checkMonth(month, "Please Choose a Month")){
                        if(checkDay(day,"Please Choose a Day")){
                            if(notEmpty(year, "Please enter Year")){
                                if(checkCountry(country,"Please Choose a Country")){
                                    if(notEmpty(add, "Please enter your address")){
                                        if(checkJob(job,"Please enter your Job")){
                                            return true;
                                        }
                                    }
                                   
                                }
                            }
                        }
                    }
                }
            }
        }
        return false;
    }

    
</script>
